<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
    </style>
</head>
<body>
    <script>
        // const list=[1,2,3,4]
        // let count=10
        // list.forEach((item)=>{
        //     count+=item
        // })
        // console.log(count);

        const list=[1,2,3,4]
        // const count=list.reduce(()=>{},初始值);
    //   const count=list.reduce((已经累加和,循环元素)=>{
        const count=list.reduce((preCount,item)=>{
            return preCount+=item
        },10);
        console.log(count);
        //      const obj = {
    //     name: "八戒",
    //     "/////": "悟空",
    //   };
    //   console.log(obj./////);
    //   console.log(obj["name"]);
    //   console.log(obj["/////"]);
    </script>   
</body>
</html>